function removeDuplicates(nums: number[]): number {
    // 1、删除原数组多余元素
    // 2、返回新数组长度
    let mSet = [...new Set(nums)];
    for(let i = 0 ;i < mSet.length; i++){
        nums[i] = mSet[i];
    }
    console.log(mSet);
    return mSet.length;
};

let nums = [1,1,2];
console.log(removeDuplicates(nums));